package guiyou.sw.agrinfo;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TabHost.OnTabChangeListener;

public class TabsActivity extends TabActivity {
	private TabHost tabHost;
//	private TabWidget tabWidget;
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.tabs);
		
		 tabHost = (TabHost) findViewById(android.R.id.tabhost);
		 LayoutInflater.from(this).inflate(R.layout.home,tabHost.getTabContentView(),true);
		 
//		 tabWidget = tabHost.getTabWidget();
		 tabHost.addTab(tabHost.newTabSpec("home")
				 .setIndicator("",this.getResources().getDrawable(R.drawable.main03))
				  .setContent(new Intent(this, Tab1Activity.class)));
		 tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("",this.getResources().getDrawable(R.drawable.wssc))
				 .setContent(new Intent(this, Tab2Activity.class)));
		 tabHost.addTab(tabHost.newTabSpec("tab3").setIndicator("",this.getResources().getDrawable(R.drawable.xzpt))
				 .setContent(new Intent(this, Tab1Activity.class)));
		 tabHost.addTab(tabHost.newTabSpec("tab4").setIndicator("",this.getResources().getDrawable(R.drawable.xypt))
				 .setContent(new Intent(this, Tab2Activity.class)));
		 tabHost.addTab(tabHost.newTabSpec("tab5").setIndicator("",this.getResources().getDrawable(R.drawable.more))
				 .setContent(new Intent(this, Tab1Activity.class)));
		  tabHost.setCurrentTab(0);
		  
		tabHost.setOnTabChangedListener(new OnTabChangeListener() {
			public void onTabChanged(String tabId) {
				
			}
		});
	}

}